package com.hutra.utils 
{
	/**
	 * ...
	 * @author hungconcon
	 */
	public class Syner 
	{
		
		public function Syner() 
		{
			
		}
		public static function synchronizeValueObject(vo:*, object:Object = null):* {
			if (object == null) return null;
			for (var key:String in object) {
				try {
					if (object[key] == 'true') {
						vo[key] = true;
					}else if (object[key] == 'false') {
						vo[key] = false;
					}else if (object[key] != undefined || object[key] != '') {
						if (typeof vo[key] == 'boolean') {
							if (object[key] == 'false') {
								vo[key]	= false;
							}
							if (object[key] == '0') {
								vo[key]	= false;
							}
							if (object[key] == 'true') {
								vo[key]	= false;
							}
							if (object[key] == '1') {
								vo[key]	= true;
							}
						}else if (typeof vo[key] == 'object') {
							vo[key]	= object[key];
						}else if (typeof vo[key] == 'number') {
							vo[key] = Number(object[key]);
						} else {
							vo[key] = String(object[key]);
						}
					}else {
					}
				}catch (ex:Error) {
				}
			}
			return vo;
		}
	}

}